/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_registro_civil;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "juez")
@NamedQueries({
    @NamedQuery(name = "Juez.findAll", query = "SELECT j FROM Juez j"),
    @NamedQuery(name = "Juez.findByIdJuez", query = "SELECT j FROM Juez j WHERE j.idJuez = :idJuez"),
    @NamedQuery(name = "Juez.findByNombre", query = "SELECT j FROM Juez j WHERE j.nombre = :nombre"),
    @NamedQuery(name = "Juez.findByApp", query = "SELECT j FROM Juez j WHERE j.app = :app"),
    @NamedQuery(name = "Juez.findByApm", query = "SELECT j FROM Juez j WHERE j.apm = :apm"),
    @NamedQuery(name = "Juez.findByCedula", query = "SELECT j FROM Juez j WHERE j.cedula = :cedula"),
    @NamedQuery(name = "Juez.findByNumJuzgado", query = "SELECT j FROM Juez j WHERE j.numJuzgado = :numJuzgado"),
    @NamedQuery(name = "Juez.findByFirma", query = "SELECT j FROM Juez j WHERE j.firma = :firma")})
public class Juez implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_juez")
    private Integer idJuez;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "app")
    private String app;
    @Column(name = "apm")
    private String apm;
    @Basic(optional = false)
    @Column(name = "cedula")
    private int cedula;
    @Column(name = "num_juzgado")
    private String numJuzgado;
    @Basic(optional = false)
    @Column(name = "firma")
    private String firma;
    @OneToMany(mappedBy = "juez")
    private List<Acta> actaList;

    public Juez() {
    }

    public Juez(Integer idJuez) {
        this.idJuez = idJuez;
    }

    public Juez(Integer idJuez, String nombre, String app, int cedula, String firma) {
        this.idJuez = idJuez;
        this.nombre = nombre;
        this.app = app;
        this.cedula = cedula;
        this.firma = firma;
    }

    public Integer getIdJuez() {
        return idJuez;
    }

    public void setIdJuez(Integer idJuez) {
        this.idJuez = idJuez;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getApm() {
        return apm;
    }

    public void setApm(String apm) {
        this.apm = apm;
    }

    public int getCedula() {
        return cedula;
    }

    public void setCedula(int cedula) {
        this.cedula = cedula;
    }

    public String getNumJuzgado() {
        return numJuzgado;
    }

    public void setNumJuzgado(String numJuzgado) {
        this.numJuzgado = numJuzgado;
    }

    public String getFirma() {
        return firma;
    }

    public void setFirma(String firma) {
        this.firma = firma;
    }

    public List<Acta> getActaList() {
        return actaList;
    }

    public void setActaList(List<Acta> actaList) {
        this.actaList = actaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idJuez != null ? idJuez.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Juez)) {
            return false;
        }
        Juez other = (Juez) object;
        if ((this.idJuez == null && other.idJuez != null) || (this.idJuez != null && !this.idJuez.equals(other.idJuez))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_registro_civil.Juez[idJuez=" + idJuez + "]";
    }

}
